package com.pkche.core.advanced.util.weixin;

import java.util.HashMap;
import java.util.Map;

import org.codehaus.jettison.json.JSONObject;


/**
 * 图片消息
 * @author Administrator
 *
 */
public class ImageMessage extends BaseMessage {
		private Media Image;

		public Media getImage() {
			return Image;
		}

		public void setImage(Media image) {
			Image = image;
		}

		public String toRespJson(){
			Map<String,Object> m = new HashMap<String, Object>();
			m.put("touser", getToUserName());
			m.put("msgtype", MessageUtil.RESP_MESSAGE_TYPE_IMAGE);
			Map<String,String> image = new HashMap<String, String>();
			image.put("media_id", getImage().getMediaId());
			m.put("image", image);
			JSONObject json = new JSONObject(m);
			return json.toString();
		}
}
